package com.example.myfirstapp;

import com.wikitude.architect.ArchitectView;
import com.wikitude.architect.ArchitectView.ArchitectConfig;

import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

public class Augmented extends Activity {
	
	private ArchitectView architectview;
	private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100;
	//private static final String MEDIA_TYPE_IMAGE = null;
	private Uri fileUri;

	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_augmented);
		
		this.architectview = (ArchitectView)this.findViewById(R.id.architectView);
		final ArchitectConfig config = new ArchitectConfig( "" /* license key */ );
		this.architectview.onCreate( config );
		
		
		// create Intent to take a picture and return control to the calling application
	    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

	    //fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
	    intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name

	    // start the image capture Intent
	    startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.augmented, menu);
		return true;
	}
	
	public void onPostCreated(){
		this.architectview.onPostCreate();
		try{
			this.architectview.load("https://www.dropbox.com/s/xwfiwa19rlcntbp/arexperience.html");

		}catch(Exception e){
			
		}
		
	}
	

}
